$(function(){
	// 注册按钮
	 $(".btn").click(function(){
	   var  userName = $('#userName').val();
	   if(userName==null || userName==''){
		  alert("请输入用户名");
		  return false;
	   }
	  
	   var password = $('#password').val();
	   if(password==null || password==''){
		   alert("请输入密码");
		   return false;
	   }
	   
	   var email = $('#email').val();
	   if(email==null || email==''){
		   alert("请输入邮箱");
		   return false;
	   }
	
	   var data={
			   userName:userName,
	           password:password,
	           email:email
	   };
	   
	    $.ajax({
	    	type:"POST",
	    	url:"/movie.front/userInfo/addUser",
	    	dataType:"json",
	    	contentType : "application/json",
	    	data:JSON.stringify(data),
	    	success:function(data){
	    		alert("注册成功");
	    		window.location="account.html";
	    		
	    	  }
	      });
		  

	  });

})